﻿namespace WebDevUtilities.VsixPkg.Extensions.AspTemplateConverter
{
    public class FileType
    {
        /// <summary>
        /// Gives the ASPX filetype extension as string.
        /// </summary>
        public const string ASPX = ".aspx";
        /// <summary>
        /// Gives the ASCX filetype extension as string.
        /// </summary>
        public const string ASCX = ".ascx";
        /// <summary>
        /// Gives the C# filetype extension as string.
        /// </summary>
        public const string CS = ".cs";
        /// <summary>
        /// Gives the C# designer filetype extension as string.
        /// </summary>
        public const string DESIGNER = ".designer.cs";
    }

    public enum TemplateType
    {
        /// <summary>
        /// the code-behind C# file
        /// </summary>
        CODEBEHIND, 
        /// <summary>
        /// the designer C# file
        /// </summary>
        DESIGNER
    }

    public class Constants
    {
        /// <summary>
        /// Edit.FormatDocument
        /// </summary>
        public const string VsDteEditFormatDocument = "Edit.FormatDocument";
        /// <summary>
        /// _tmp_
        /// </summary>
        public const string TempSuffix = "_tmp_";
        /// <summary>
        /// FullPath
        /// </summary>
        public const string ProjectItemPropertyFullPath = "FullPath";
        /// <summary>
        /// //script[@runat='server']
        /// </summary>
        public const string NodeServerScript = "//script[@runat='server']";
        /// <summary>
        /// LayoutsPageBase
        /// </summary>
        public const string ASPXLayoutDefaultBaseClass = "LayoutsPageBase";
        /// <summary>
        /// UserControl
        /// </summary>
        public const string ASCXLayoutDefaultBaseClass = "UserControl";
        /// <summary>
        /// <%@ Assembly
        /// </summary>
        public const string AspElementAssemblyStart = "<%@ Assembly";
        /// <summary>
        /// <%@ Assembly Name=\"$SharePoint.Project.AssemblyFullName$\" %>
        /// </summary>
        public const string AspElementAssemblySharePoint = "<%@ Assembly Name=\"$SharePoint.Project.AssemblyFullName$\" %>";
        /// <summary>
        /// <%@ Assembly Name=\"Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c\" %>
        /// </summary>
        public const string AspElementAssemblyCommandUI = "<%@ Assembly Name=\"Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c\" %>";
        /// <summary>
        /// <%@ Import Namespace=
        /// </summary>
        public const string AspElementImportStart = "<%@ Import Namespace=";
        /// <summary>
        /// <%@ Control
        /// </summary>
        public const string AspElementControlStart = "<%@ Control";
        /// <summary>
        /// <%@ Control CodeBehind=\"{0}.cs\" Inherits=\"{1}.{2}\" AutoEventWireup=\"true\" Language=\"C#\" %>\n
        /// </summary>
        public const string AspSnippetElementControl = "<%@ Control CodeBehind=\"{0}.cs\" Inherits=\"{1}.{2}\" AutoEventWireup=\"true\" Language=\"C#\" %>\n";
        /// <summary>
        /// ClassName=
        /// </summary>
        public const string NodeControlClassNameString = "ClassName=";
        /// <summary>
        /// using {0};
        /// </summary>
        public const string UsingDeclaration = "using {0};";
        /// <summary>
        /// ASCX Designer file string format
        /// </summary>
        public const string ASCXDesignerTemplate = @"
namespace {0}
{{
    public partial class {1}
    {{
    }}
}}";
        /// <summary>
        /// ASCX Code file string format
        /// </summary>
        public const string ASCXCodeTemplate = @"
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;{0}
namespace {1}
{{
    public partial class {2} : {3}
    {{
        protected void Page_Load(object sender, EventArgs e)
        {{
        }}{4}
    }}
}}";
        /// <summary>
        /// ASPX Designer file string format
        /// </summary>
        public const string ASPXDesignerTemplate = @"
namespace {0}
{{
    public partial class {1}
    {{
    }}
}}";
        /// <summary>
        /// ASPX Code file string format
        /// </summary>
        public const string ASPXCodeTemplate = @"
using System;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;{0}
namespace {1}
{{
    public partial class {2} : {3}
    {{
        protected void Page_Load(object sender, EventArgs e)
        {{
        }}{4}
    }}
}}";
    }
}
